package com.management.service.Impl;

import com.management.dao.DeptDao;
import com.management.po.Dept;
import com.management.service.DeptService;
import com.management.vo.DeptVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author XS
 * 部门的业务逻辑实现类
 */
@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    DeptDao deptDao;
    @Override
    public List<DeptVO> findAll() {
        return deptDao.findAll();
    }

    @Override
    public DeptVO findByDeptId(int deptId) {
        return deptDao.findByDeptId(deptId);
    }

    @Override
    public boolean add(Dept dept) {
        return deptDao.add(dept)>0?true:false;
    }

    @Override
    public boolean update(Dept dept) {
        return deptDao.update(dept)>0?true:false;
    }

    @Override
    public List<DeptVO> findByCompanyId(int companyId) {
        return deptDao.findByCompanyId(companyId);
    }
}
